const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    headless: true,
    args: ['--ignore-certificate-errors', '--user-data-dir=test-profile-dir', '--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage']
  });

  const page = await browser.newPage();
  await page.setExtraHTTPHeaders({'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36'});

  await page.goto('https://g3.luciaz.me/ip_ban_verify_page?origin=aHR0cHM6Ly9nMy5sdWNpYXoubWUv');

  console.log('111');

  const htmlInfo = await page.evaluate(() => {
    return document.querySelector('body').innerHTML;
  });
  console.log(htmlInfo);

  await page.click('body > form > input[type=text]:nth-child(7)');

  await page.keyboard.type('心灵之约');

  await page.keyboard.press('Enter');

})();
